/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.DAO;

import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import verins.beans.Rol;

/**
 *
 * @author hectdx
 */
public class ReportesDAO {
     public List findAll(){
        List<Rol> lista=null;
        try{

            EntityManagerFactory emf = Persistence.createEntityManagerFactory("verinsPU");
            EntityManager em = emf.createEntityManager();
            Query query=em.createNamedQuery("Reporte.findAll");

            lista=query.getResultList();

            em.close();
            emf.close();

        }catch(Exception ex){
            System.out.println(ex.getMessage());
        }
        return lista;
    }
}
